<?php
/**
 *
 *  @author  wangzhoudong  <admin@zhen.pl>
 *  @version    1.0
 *
 */
class InputArea extends CWidget {
	public $textArea = false;
	/**
	 *
	 * @var string html dom标签
	 */
	public $id = '';
	
	/**
	 *
	 * @var string html dom标签
	 */
	public $name = 'area';
	/**
	 *
	 * @var string 默认选中值
	 */
	public $value = '';
	/**
	 *
	 * @var string 展示类型提供select,div
	 */
	public $type = 'select';
	
	public $func  = '';
	/**
	 *
	 * @var string 对应的数据
	 */
	private $_data = array ();
	public function init() {
		$data = array ();
		$ids = '';
		$fids = '';
		if ($this->value) {
			$this->_data = BaseAreaModel::model ()->findByPk ( $this->value );
			$fids = $this->_data['fids'];
		}
		$this->id = $this->id ? $this->id :  $this->name;
		$jqueryId =  str_replace(array('[',']'), array('\\\\[','\\\\]'),$this->id);
		$this->render ( 'input_area_' . $this->type, array (
				'id' => $this->id,
				'name' => $this->name,
				'value' => $this->value,
				'jqueryId' => $jqueryId,
				'data' => $this->_data ,
				'func' => $this->func ,
				'fids' => $fids 
		) );

		
	}
}
